﻿using System;
using System.Runtime.Serialization;

namespace MyFramework.Core
{
    /// <summary>
    /// controller disposed exception
    /// </summary>
    [Serializable]
    public class ControllerDisposedException : ObjectDisposedException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ControllerDisposedException"/> class.
        /// </summary>
        public ControllerDisposedException()
            : base(string.Empty) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="ControllerDisposedException"/> class.
        /// </summary>
        /// <param name="objectName">The name of the disposed object.</param>
        /// <param name="message">The error message that explains the reason for the exception.</param>
        public ControllerDisposedException(string objectName, string message)
            : base(objectName, message) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="ControllerDisposedException"/> class.
        /// </summary>
        /// <param name="message">The error message that explains the reason for the exception.</param>
        /// <param name="innerException">The exception that is the cause of the current exception. If <paramref name="innerException" /> is not null, the current exception is raised in a catch block that handles the inner exception.</param>
        public ControllerDisposedException(string message, Exception innerException)
            : base(message, innerException) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="ControllerDisposedException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
        protected ControllerDisposedException(SerializationInfo info, StreamingContext context)
            : base(info, context) { }

    }
}
